home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_windowmaker.idb / usr / freeware / include / WINGs.h.z / WINGs.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  28.1 KB  |  1,123 lines

  1.  
  2.  
  3. #ifndef _WINGS_H_
  4. #define _WINGS_H_
  5.  
  6. #include <wraster.h>
  7. #include <X11/Xlib.h>
  8.  
  9. #define WINGS_H_VERSION  990316
  10.  
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif /* __cplusplus */
  15. #if 0
  16. }
  17. #endif
  18.  
  19.  
  20. typedef unsigned long WMPixel;
  21.  
  22.  
  23. typedef struct {
  24.     unsigned int width;
  25.     unsigned int height;
  26. } WMSize;
  27.  
  28. typedef struct {
  29.     int x;
  30.     int y;
  31. } WMPoint;
  32.  
  33. typedef struct {
  34.     WMPoint pos;
  35.     WMSize size;
  36. } WMRect;
  37.  
  38. typedef struct {
  39.     int position;
  40.     int count;
  41. } WMRange;
  42.  
  43.  
  44. #define ClientMessageMask    (1L<<30)
  45.  
  46.  
  47. /* window stacking level */
  48. enum {
  49.   WMNormalWindowLevel   = 0,
  50.   WMFloatingWindowLevel  = 3,
  51.   WMDockWindowLevel   = 5,
  52.   WMSubmenuWindowLevel  = 10,
  53.   WMMainMenuWindowLevel  = 20
  54. };
  55.  
  56. /* window attributes */
  57. enum {
  58.   WMBorderlessWindowMask = 0,
  59.   WMTitledWindowMask = 1,
  60.   WMClosableWindowMask = 2,
  61.   WMMiniaturizableWindowMask = 4,
  62.   WMResizableWindowMask = 8
  63. };
  64.  
  65.  
  66. /* button types */
  67. typedef enum {
  68.     /* 0 is reserved for internal use */
  69.     WBTMomentaryPush = 1,
  70.     WBTPushOnPushOff = 2,
  71.     WBTToggle = 3,
  72.     WBTSwitch = 4,
  73.     WBTRadio = 5,
  74.     WBTMomentaryChange = 6,
  75.     WBTOnOff = 7,
  76.     WBTMomentaryLight = 8
  77. } WMButtonType;
  78.  
  79. /* button behaviour masks */
  80. enum {
  81.     WBBSpringLoadedMask =     (1 << 0),
  82.     WBBPushInMask =     (1 << 1),
  83.     WBBPushChangeMask =     (1 << 2),
  84.     WBBPushLightMask =     (1 << 3),
  85.     WBBStateLightMask =     (1 << 5),
  86.     WBBStateChangeMask =     (1 << 6),
  87.     WBBStatePushMask =     (1 << 7)
  88. };
  89.  
  90.  
  91. /* frame title positions */
  92. typedef enum {
  93.     WTPNoTitle,
  94.     WTPAboveTop,
  95.     WTPAtTop,
  96.     WTPBelowTop,
  97.     WTPAboveBottom,
  98.     WTPAtBottom,
  99.     WTPBelowBottom
  100. } WMTitlePosition;
  101.  
  102.  
  103. /* relief types */
  104. typedef enum {
  105.     WRFlat,
  106.     WRSimple,
  107.     WRRaised,
  108.     WRSunken,
  109.     WRGroove,
  110.     WRRidge,
  111.     WRPushed
  112. } WMReliefType;
  113.  
  114.  
  115. /* alignment types */
  116. typedef enum {
  117.     WALeft,
  118.     WACenter,
  119.     WARight,
  120.     WAJustified               /* not valid for textfields */
  121. } WMAlignment;
  122.  
  123.  
  124. /* image position */
  125. typedef enum {
  126.     WIPNoImage,
  127.     WIPImageOnly,
  128.     WIPLeft,
  129.     WIPRight,
  130.     WIPBelow,
  131.     WIPAbove,
  132.     WIPOverlaps
  133. } WMImagePosition;
  134.  
  135.  
  136. /* scroller arrow position */
  137. typedef enum {
  138.     WSAMaxEnd,
  139.     WSAMinEnd,
  140.     WSANone
  141. } WMScrollArrowPosition;
  142.  
  143. /* scroller parts */
  144. typedef enum {
  145.     WSNoPart,
  146.     WSDecrementPage,
  147.     WSIncrementPage,
  148.     WSDecrementLine,
  149.     WSIncrementLine,
  150.     WSKnob,
  151.     WSKnobSlot
  152. } WMScrollerPart;
  153.  
  154. /* usable scroller parts */
  155. typedef enum {
  156.     WSUNoParts,
  157.     WSUOnlyArrows,
  158.     WSUAllParts
  159. } WMUsableScrollerParts;
  160.  
  161. /* matrix types */
  162. typedef enum {
  163.     WMMRadioMode,
  164.     WMMHighlightMode,
  165.     WMMListMode,
  166.     WMMTrackMode
  167. } WMMatrixTypes;
  168.  
  169.  
  170. /* text movement types */
  171. enum {
  172.     WMIllegalTextMovement,
  173.     WMReturnTextMovement,
  174.     WMTabTextMovement,
  175.     WMBacktabTextMovement,
  176.     WMLeftTextMovement,
  177.     WMRightTextMovement,
  178.     WMUpTextMovement,
  179.     WMDownTextMovement
  180. };
  181.  
  182. /* text field special events */
  183. enum {
  184.     WMSetTextEvent,
  185.     WMInsertTextEvent,
  186.     WMDeleteTextEvent
  187. };
  188.  
  189.  
  190. typedef enum {
  191.     WMGrayModeColorPanel,
  192.      WMRGBModeColorPanel,
  193.     WMCMYKModeColorPanel,
  194.     WMHSBModeColorPanel,
  195.     WMCustomPaletteModeColorPanel,
  196.     WMColorListModeColorPanel,
  197.     WMWheelModeColorPanel
  198. } WMColorPanelMode;
  199.  
  200.  
  201.  
  202. /* system images */
  203. #define WSIReturnArrow            1
  204. #define WSIHighlightedReturnArrow    2
  205. #define WSIScrollerDimple        3
  206. #define WSIArrowLeft            4
  207. #define WSIHighlightedArrowLeft            5
  208. #define WSIArrowRight            6
  209. #define WSIHighlightedArrowRight    7
  210. #define WSIArrowUp            8
  211. #define WSIHighlightedArrowUp        9
  212. #define WSIArrowDown            10
  213. #define WSIHighlightedArrowDown        11
  214. #define WSICheckMark            12
  215.  
  216. enum {
  217.     WLDSSelected = (1 << 16),
  218.     WLDSDisabled = (1 << 17),
  219.     WLDSFocused = (1 << 18),
  220.     WLDSIsBranch = (1 << 19)
  221. };
  222.  
  223. /* alert panel return values */
  224. enum {
  225.     WAPRDefault = 0,
  226.     WAPRAlternate = 1,
  227.     WAPROther = -1,
  228.     WAPRError = -2
  229. };
  230.  
  231.  
  232.  
  233. /* types of input observers */
  234. enum {
  235.     WIReadMask = (1 << 0),
  236.     WIWriteMask = (1 << 1),
  237.     WIExceptMask = (1 << 2)
  238. };
  239.  
  240.  
  241.  
  242. typedef int W_Class;
  243.  
  244. enum {
  245.     WC_Window = 0,
  246.     WC_Frame = 1,
  247.     WC_Label = 2,
  248.     WC_Button = 3,
  249.     WC_TextField = 4,
  250.     WC_Scroller    = 5,
  251.     WC_ScrollView = 6,
  252.     WC_List = 7,
  253.     WC_Browser = 8,
  254.     WC_PopUpButton = 9,
  255.     WC_ColorWell = 10,
  256.     WC_Slider = 11,
  257.     WC_Matrix = 12,               /* not ready */
  258.     WC_SplitView = 13
  259. };
  260.  
  261. /* All widgets must start with the following structure
  262.  * in that order. Used for typecasting to get some generic data */
  263. typedef struct W_WidgetType {
  264.     W_Class widgetClass;
  265.     struct W_View *view;
  266.     
  267. } W_WidgetType;
  268.  
  269.  
  270. #define WMWidgetClass(widget)      (((W_WidgetType*)(widget))->widgetClass)
  271. #define WMWidgetView(widget)       (((W_WidgetType*)(widget))->view)
  272.  
  273.  
  274. /* widgets */
  275.  
  276. typedef void WMWidget;
  277.  
  278. typedef struct W_Pixmap WMPixmap;
  279. typedef struct W_Font    WMFont;
  280. typedef struct W_Color    WMColor;
  281.  
  282. typedef struct W_Screen WMScreen;
  283.  
  284. typedef struct W_View WMView;
  285.  
  286. typedef struct W_Window WMWindow;
  287. typedef struct W_Frame WMFrame;
  288. typedef struct W_Button WMButton;
  289. typedef struct W_Label WMLabel;
  290. typedef struct W_TextField WMTextField;
  291. typedef struct W_Scroller WMScroller;
  292. typedef struct W_ScrollView WMScrollView;
  293. typedef struct W_List WMList;
  294. typedef struct W_Browser WMBrowser;
  295. typedef struct W_PopUpButton WMPopUpButton;
  296. typedef struct W_ColorWell WMColorWell;
  297. typedef struct W_Slider WMSlider;
  298. typedef struct W_Matrix WMMatrix;      /* not ready */
  299. typedef struct W_SplitView WMSplitView;
  300.  
  301. /* not widgets */
  302. typedef struct W_FilePanel WMFilePanel;
  303. typedef WMFilePanel WMOpenPanel;
  304. typedef WMFilePanel WMSavePanel;
  305.  
  306. typedef struct W_FontPanel WMFontPanel;
  307.  
  308. typedef struct W_ColorPanel WMColorPanel;
  309.  
  310.  
  311. /* item for WMList */
  312. typedef struct WMListItem {
  313.     char *text;
  314.     void *clientData;               /* ptr for user clientdata. */
  315.         
  316.     struct WMListItem *nextPtr;
  317.     
  318.     unsigned int uflags:16;           /* flags for the user */
  319.     unsigned int selected:1;
  320.     unsigned int disabled:1;
  321.     unsigned int isBranch:1;
  322.     unsigned int loaded:1;
  323. } WMListItem;
  324.  
  325. /* struct for message panel */
  326. typedef struct WMAlertPanel {
  327.     WMWindow *win;               /* window */
  328.     WMButton *defBtn;               /* default button */
  329.     WMButton *altBtn;               /* alternative button */
  330.     WMButton *othBtn;               /* other button */
  331.     WMLabel *iLbl;               /* icon label */
  332.     WMLabel *tLbl;               /* title label */
  333.     WMLabel *mLbl;               /* message label */
  334.     WMFrame *line;               /* separator */
  335.     short result;               /* button that was pushed */
  336.     short done;
  337.     
  338.     KeyCode retKey;
  339. } WMAlertPanel;
  340.  
  341.  
  342. typedef struct WMInputPanel {
  343.     WMWindow *win;               /* window */
  344.     WMButton *defBtn;               /* default button */
  345.     WMButton *altBtn;               /* alternative button */
  346.     WMLabel *tLbl;               /* title label */
  347.     WMLabel *mLbl;               /* message label */
  348.     WMTextField *text;               /* text field */
  349.     short result;               /* button that was pushed */
  350.     short done;
  351.     
  352.     KeyCode retKey;
  353. } WMInputPanel;
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361. typedef void *WMHandlerID;
  362.  
  363. typedef void WMInputProc(int fd, int mask, void *clientData);
  364.  
  365. typedef void WMEventProc(XEvent *event, void *clientData);
  366.  
  367. typedef void WMEventHook(XEvent *event);
  368.  
  369. /* self is set to the widget from where the callback is being called and
  370.  * clientData to the data set to with WMSetClientData() */
  371. typedef void WMAction(WMWidget *self, void *clientData);
  372.  
  373.  
  374. typedef void WMCallback(void *data);
  375.  
  376.  
  377. /* delegate method like stuff */
  378. typedef void WMFreeDataProc(void *data);
  379.  
  380. typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
  381.                 int state, WMRect *rect);
  382.  
  383. /*
  384. typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
  385.                        unsigned int oldWidth,
  386.                        unsigned int oldHeight);
  387. */
  388.  
  389. typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
  390.                       int *minCoordinate, int *maxCoordinate);
  391.  
  392. typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
  393.  
  394.  
  395. typedef void WMBrowserFillColumnProc(WMBrowser *bPtr, int column);
  396.  
  397.  
  398. typedef Bool WMConvertSelectionProc(WMWidget *w, Atom selection, Atom target,
  399.                     Atom *type, void **value, unsigned *length,
  400.                     int *format);
  401.  
  402. typedef void WMLoseSelectionProc(WMWidget *w, Atom selection);
  403.  
  404. typedef void WMSelectionDoneProc(WMWidget *w, Atom selection, Atom target);
  405.  
  406. /* ....................................................................... */
  407.  
  408.  
  409.  
  410. void WMInitializeApplication(char *applicationName, int *argc, char **argv);
  411.  
  412. void WMSetApplicationDataPath(char *path);
  413.  
  414. /* don't free the returned string */
  415. char *WMGetApplicationName();
  416.  
  417. /* Try to locate resource file. ext may be NULL */
  418. char *WMPathForResourceOfType(char *resource, char *ext);
  419.  
  420. WMScreen *WMCreateScreenWithRContext(Display *display, int screen, 
  421.                      RContext *context);
  422.  
  423. WMScreen *WMCreateScreen(Display *display, int screen);
  424.  
  425. WMScreen *WMCreateSimpleApplicationScreen(Display *display);
  426.  
  427. void WMScreenMainLoop(WMScreen *scr);
  428.  
  429.  
  430. RContext *WMScreenRContext(WMScreen *scr);
  431.  
  432. Display *WMScreenDisplay(WMScreen *scr);
  433.  
  434. int WMScreenDepth(WMScreen *scr);
  435.  
  436.  
  437.  
  438. void WMSetApplicationIconImage(WMScreen *app, WMPixmap *icon);
  439.  
  440. WMPixmap *WMGetApplicationIconImage(WMScreen *app);
  441.  
  442. void WMSetFocusToWidget(WMWidget *widget);
  443.  
  444. WMEventHook *WMHookEventHandler(WMEventHook *handler);
  445.  
  446. int WMHandleEvent(XEvent *event);
  447.  
  448. Bool WMScreenPending(WMScreen *scr);
  449.  
  450. void WMCreateEventHandler(WMView *view, unsigned long mask,
  451.               WMEventProc *eventProc, void *clientData);
  452.  
  453. void WMDeleteEventHandler(WMView *view, unsigned long mask,
  454.               WMEventProc *eventProc, void *clientData);
  455.  
  456. int WMIsDoubleClick(XEvent *event);
  457.  
  458. void WMNextEvent(Display *dpy, XEvent *event);
  459.  
  460. void WMMaskEvent(Display *dpy, long mask, XEvent *event);
  461.  
  462. WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback *callback, 
  463.                   void *cdata);
  464.  
  465. void WMDeleteTimerWithClientData(void *cdata);
  466.  
  467. void WMDeleteTimerHandler(WMHandlerID handlerID);
  468.  
  469. WMHandlerID WMAddIdleHandler(WMCallback *callback, void *cdata);
  470.  
  471. void WMDeleteIdleHandler(WMHandlerID handlerID);
  472.  
  473. WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc *proc, 
  474.                   void *clientData);
  475.  
  476. void WMDeleteInputHandler(WMHandlerID handlerID);
  477.  
  478. /* ....................................................................... */
  479. /*
  480. void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
  481.              WMSize mouseOffset, XEvent *event, Bool slideBack);
  482.  
  483. */
  484.  
  485. /* ....................................................................... */
  486.  
  487. WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName);
  488.  
  489. WMFont *WMCreateFontInDefaultEncoding(WMScreen *scrPtr, char *fontName);
  490.  
  491. WMFont *WMRetainFont(WMFont *font);
  492.  
  493. void WMReleaseFont(WMFont *font);
  494.  
  495. unsigned int WMFontHeight(WMFont *font);
  496.  
  497. /*
  498. WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
  499.  
  500. WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
  501. */
  502.  
  503. WMFont *WMSystemFontOfSize(WMScreen *scrPtr, int size);
  504.  
  505. WMFont *WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
  506.  
  507. XFontSet WMGetFontFontSet(WMFont *font);
  508.  
  509. /* ....................................................................... */
  510.  
  511. WMPixmap *WMRetainPixmap(WMPixmap *pixmap);
  512.  
  513. void WMReleasePixmap(WMPixmap *pixmap);
  514.  
  515. WMPixmap *WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
  516.              Bool masked);
  517.  
  518. WMPixmap *WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap, 
  519.                      Pixmap mask, int width, int height,
  520.                      int depth);
  521.  
  522. WMPixmap *WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image, 
  523.                    int threshold);
  524.  
  525. WMPixmap *WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
  526.  
  527. WMSize WMGetPixmapSize(WMPixmap *pixmap);
  528.  
  529. WMPixmap *WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
  530.  
  531. WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
  532.                     RColor *color);
  533.  
  534. void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
  535.  
  536. Pixmap WMGetPixmapXID(WMPixmap *pixmap);
  537.  
  538. Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
  539.  
  540. WMPixmap *WMGetSystemPixmap(WMScreen *scr, int image);
  541.  
  542. /* ....................................................................... */
  543.  
  544.  
  545. WMColor *WMDarkGrayColor(WMScreen *scr);
  546.  
  547. WMColor *WMGrayColor(WMScreen *scr);
  548.  
  549. WMColor *WMBlackColor(WMScreen *scr);
  550.  
  551. WMColor *WMWhiteColor(WMScreen *scr);
  552.  
  553. void WMSetColorInGC(WMColor *color, GC gc);
  554.  
  555. GC WMColorGC(WMColor *color);
  556.  
  557. WMPixel WMColorPixel(WMColor *color);
  558.  
  559. void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y, 
  560.             unsigned int width, unsigned int height);
  561.  
  562. void WMReleaseColor(WMColor *color);
  563.  
  564. WMColor *WMRetainColor(WMColor *color);
  565.  
  566. WMColor *WMCreateRGBColor(WMScreen *scr, unsigned short red, 
  567.               unsigned short green, unsigned short blue,
  568.               Bool exact);
  569.  
  570. WMColor *WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
  571.  
  572. unsigned short WMRedComponentOfColor(WMColor *color);
  573.  
  574. unsigned short WMGreenComponentOfColor(WMColor *color);
  575.  
  576. unsigned short WMBlueComponentOfColor(WMColor *color);
  577.  
  578. char *WMGetColorRGBDescription(WMColor *color);
  579.  
  580. /* ....................................................................... */
  581.  
  582.  
  583. void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, 
  584.           int y, char *text, int length);
  585.  
  586. void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, 
  587.                int y, char *text, int length);
  588.  
  589. int WMWidthOfString(WMFont *font, char *text, int length);
  590.  
  591.  
  592.  
  593. /* ....................................................................... */
  594.  
  595. WMScreen *WMWidgetScreen(WMWidget *w);
  596.  
  597. void WMUnmapWidget(WMWidget *w);
  598.  
  599. void WMMapWidget(WMWidget *w);
  600.  
  601. void WMMoveWidget(WMWidget *w, int x, int y);
  602.  
  603. void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
  604.  
  605. void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
  606.  
  607. void WMMapSubwidgets(WMWidget *w);
  608.  
  609. void WMUnmapSubwidgets(WMWidget *w);
  610.  
  611. void WMRealizeWidget(WMWidget *w);
  612.  
  613. void WMDestroyWidget(WMWidget *widget);
  614.  
  615. void WMHangData(WMWidget *widget, void *data);
  616.  
  617. void *WMGetHangedData(WMWidget *widget);
  618.  
  619. unsigned int WMWidgetWidth(WMWidget *w);
  620.  
  621. unsigned int WMWidgetHeight(WMWidget *w);
  622.  
  623. Window WMWidgetXID(WMWidget *w);
  624.  
  625. Window WMViewXID(WMView *view);
  626.  
  627. void WMRedisplayWidget(WMWidget *w);
  628.  
  629. void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
  630.  
  631. WMSize WMGetViewSize(WMView *view);
  632.  
  633. WMPoint WMGetViewPosition(WMView *view);
  634.  
  635. WMWidget *WMWidgetOfView(WMView *view);
  636.  
  637. /* notifications */
  638. extern char *WMViewSizeDidChangeNotification;
  639.  
  640. extern char *WMViewRealizedNotification;
  641.  
  642. /* ....................................................................... */
  643.  
  644. WMWindow *WMCreateWindow(WMScreen *screen, char *name);
  645.  
  646. WMWindow *WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
  647.  
  648. WMWindow *WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name, 
  649.                       int style);
  650.  
  651. WMWindow *WMCreatePanelForWindow(WMWindow *owner, char *name);
  652.  
  653. void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
  654.  
  655. void WMSetWindowTitle(WMWindow *wPtr, char *title);
  656.  
  657. void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
  658.  
  659. void WMSetWindowMiniwindowImage(WMWindow *win, WMPixmap *pixmap);
  660.  
  661. void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
  662.  
  663. void WMSetWindowUPosition(WMWindow *win, int x, int y);
  664.  
  665. void WMSetWindowUSize(WMWindow *win, unsigned width, unsigned height);
  666.  
  667. void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
  668.  
  669. void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
  670.  
  671. void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
  672.  
  673. void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
  674.  
  675. void WMSetWindowLevel(WMWindow *win, int level);
  676.  
  677. void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
  678.  
  679. void WMCloseWindow(WMWindow *win);
  680.  
  681. /* ....................................................................... */
  682.  
  683. void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
  684.  
  685. #define WMCreateCommandButton(parent) \
  686.     WMCreateCustomButton((parent), WBBSpringLoadedMask\
  687.                     |WBBPushInMask\
  688.                     |WBBPushLightMask\
  689.                     |WBBPushChangeMask)
  690.  
  691. #define WMCreateRadioButton(parent) \
  692.     WMCreateButton((parent), WBTRadio)
  693.  
  694. #define WMCreateSwitchButton(parent) \
  695.     WMCreateButton((parent), WBTSwitch)
  696.  
  697. WMButton *WMCreateButton(WMWidget *parent, WMButtonType type);
  698.  
  699. WMButton *WMCreateCustomButton(WMWidget *parent, int behaviourMask);
  700.  
  701. void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
  702.  
  703. void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
  704.  
  705. void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
  706.  
  707. void WMSetButtonFont(WMButton *bPtr, WMFont *font);
  708.  
  709. void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
  710.  
  711. void WMSetButtonText(WMButton *bPtr, char *text);
  712.  
  713. void WMSetButtonAltText(WMButton *bPtr, char *text);
  714.  
  715. void WMSetButtonSelected(WMButton *bPtr, int isSelected);
  716.  
  717. int WMGetButtonSelected(WMButton *bPtr);
  718.  
  719. void WMSetButtonBordered(WMButton *bPtr, int isBordered);
  720.  
  721. void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
  722.  
  723. void WMSetButtonTag(WMButton *bPtr, int tag);
  724.  
  725. void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
  726.  
  727. void WMPerformButtonClick(WMButton *bPtr);
  728.  
  729. void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
  730.  
  731. void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
  732.  
  733. /* ....................................................................... */
  734.  
  735. WMLabel *WMCreateLabel(WMWidget *parent);
  736.  
  737. void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
  738.  
  739. void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
  740.  
  741. WMPixmap *WMGetLabelImage(WMLabel *lPtr);
  742.  
  743. void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
  744.     
  745. void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
  746.  
  747. void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
  748.     
  749. void WMSetLabelText(WMLabel *lPtr, char *text);
  750.  
  751. void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
  752.  
  753. void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
  754.  
  755. /* ....................................................................... */
  756.  
  757. WMFrame *WMCreateFrame(WMWidget *parent);
  758.  
  759. void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
  760.  
  761. void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
  762.  
  763. void WMSetFrameTitle(WMFrame *fPtr, char *title);
  764.  
  765. /* ....................................................................... */
  766.  
  767. WMTextField *WMCreateTextField(WMWidget *parent);
  768.  
  769. void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
  770.  
  771. void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
  772.  
  773. /* you can free the returned string */
  774. char *WMGetTextFieldText(WMTextField *tPtr);
  775.  
  776. void WMSetTextFieldText(WMTextField *tPtr, char *text);
  777.  
  778. void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
  779.  
  780. void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
  781.  
  782. void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
  783.  
  784. Bool WMGetTextFieldEditable(WMTextField *tPtr);
  785.  
  786. void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
  787.  
  788. void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
  789.  
  790. void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
  791.  
  792. void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
  793.  
  794. void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
  795.  
  796. void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
  797.  
  798.  
  799. extern char *WMTextDidChangeNotification;
  800. extern char *WMTextDidBeginEditingNotification;
  801. extern char *WMTextDidEndEditingNotification;
  802.  
  803. /* ....................................................................... */
  804.  
  805. WMScroller *WMCreateScroller(WMWidget *parent);
  806.  
  807. void WMSetScrollerParameters(WMScroller *sPtr, float floatValue, 
  808.                  float knobProportion);
  809.  
  810. float WMGetScrollerKnobProportion(WMScroller *sPtr);
  811.  
  812. float WMGetScrollerValue(WMScroller *sPtr);
  813.  
  814. WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
  815.  
  816. void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
  817.  
  818. void WMSetScrollerArrowsPosition(WMScroller *sPtr, 
  819.                  WMScrollArrowPosition position);
  820.  
  821. /* ....................................................................... */
  822.  
  823. WMList *WMCreateList(WMWidget *parent);
  824.  
  825. #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
  826.  
  827. WMListItem *WMInsertListItem(WMList *lPtr, int row, char *text);
  828.  
  829. WMListItem *WMAddSortedListItem(WMList *lPtr, char *text);
  830.  
  831. int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
  832.  
  833. WMListItem *WMGetListItem(WMList *lPtr, int row);
  834.  
  835. void WMRemoveListItem(WMList *lPtr, int row);
  836.  
  837. void WMSelectListItem(WMList *lPtr, int row);
  838.  
  839. void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
  840.  
  841. void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
  842.  
  843. int WMGetListItemHeight(WMList *lPtr);
  844.  
  845. /* don't free the returned data */
  846. WMListItem *WMGetListSelectedItem(WMList *lPtr);
  847.  
  848. int WMGetListSelectedItemRow(WMList *lPtr);
  849.  
  850. void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
  851.  
  852. void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
  853.  
  854. void WMClearList(WMList *lPtr);
  855.  
  856. int WMGetListNumberOfRows(WMList *lPtr);
  857.  
  858. void WMSetListPosition(WMList *lPtr, int row);
  859.  
  860. void WMSetListBottomPosition(WMList *lPtr, int row);
  861.  
  862. int WMGetListPosition(WMList *lPtr);
  863.  
  864. extern char *WMListDidScrollNotification;
  865. extern char *WMListSelectionDidChangeNotification;
  866.  
  867. /* ....................................................................... */
  868.  
  869. WMBrowser *WMCreateBrowser(WMWidget *parent);
  870.  
  871. void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
  872.  
  873. void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
  874.  
  875. void WMLoadBrowserColumnZero(WMBrowser *bPtr);
  876.  
  877. int WMAddBrowserColumn(WMBrowser *bPtr);
  878.  
  879. void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
  880.  
  881. void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
  882.  
  883. void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
  884.  
  885. WMListItem *WMAddSortedBrowserItem(WMBrowser *bPtr, int column, char *text, Bool isBranch);
  886.  
  887. WMListItem *WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
  888.  
  889. /* Don't free the returned string. */
  890. char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
  891.  
  892. /* you can free the returned string */
  893. char *WMGetBrowserPath(WMBrowser *bPtr);
  894. /* you can free the returned string */
  895. char *WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
  896.  
  897. void WMSetBrowserFillColumnProc(WMBrowser *bPtr,WMBrowserFillColumnProc *proc);
  898.  
  899. void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
  900.  
  901. void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action, 
  902.                   void *clientData);
  903.  
  904. WMListItem *WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
  905.  
  906. int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
  907.  
  908. int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
  909.  
  910. int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
  911.  
  912. int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
  913.  
  914. WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
  915.  
  916. extern char *WMBrowserDidScrollNotification;
  917.  
  918. /* ....................................................................... */
  919.  
  920. WMPopUpButton *WMCreatePopUpButton(WMWidget *parent);
  921.  
  922. void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action, 
  923.                 void *clientData);
  924.  
  925. void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
  926.  
  927. void WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
  928.  
  929. void WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index, char *title);
  930.  
  931. void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
  932.  
  933. void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
  934.  
  935. void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
  936.  
  937. int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
  938.  
  939. void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
  940.  
  941. /* don't free the returned data */
  942. char *WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
  943.  
  944. int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
  945.  
  946. void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
  947.  
  948. /* ....................................................................... */
  949.  
  950. WMColorPanel *WMGetColorPanel(WMScreen *scrPtr);
  951.  
  952. void WMFreeColorPanel(WMColorPanel *panel);
  953.  
  954. void WMShowColorPanel(WMColorPanel *panel);
  955.  
  956. void WMCloseColorPanel(WMColorPanel *panel);
  957.  
  958. void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
  959.  
  960. RColor WMGetColorPanelColor(WMColorPanel *panel);
  961.  
  962. void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
  963.  
  964. void WMSetColorPanelAction(WMColorPanel *panel, WMAction *action, void *data);
  965.  
  966.  
  967.  
  968. /* ....................................................................... */
  969.  
  970. WMColorWell *WMCreateColorWell(WMWidget *parent);
  971.  
  972. void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
  973.  
  974. WMColor *WMGetColorWellColor(WMColorWell *cPtr);
  975.  
  976. void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
  977.  
  978.  
  979. extern char *WMColorWellDidChangeNotification;
  980.  
  981.  
  982. /* ...................................................................... */
  983.  
  984. WMScrollView *WMCreateScrollView(WMWidget *parent);
  985.  
  986. void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
  987.                    unsigned int height);
  988.  
  989. void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
  990.  
  991. void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
  992.  
  993. void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
  994.  
  995. void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
  996.  
  997. void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
  998.  
  999. WMScroller *WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
  1000.  
  1001. WMScroller *WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
  1002.  
  1003. void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
  1004.  
  1005. void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
  1006.  
  1007. /* ....................................................................... */
  1008.  
  1009. WMSlider *WMCreateSlider(WMWidget *parent);
  1010.  
  1011. int WMGetSliderMinValue(WMSlider *slider);
  1012.  
  1013. int WMGetSliderMaxValue(WMSlider *slider);
  1014.  
  1015. int WMGetSliderValue(WMSlider *slider);
  1016.  
  1017. void WMSetSliderMinValue(WMSlider *slider, int value);
  1018.  
  1019. void WMSetSliderMaxValue(WMSlider *slider, int value);
  1020.  
  1021. void WMSetSliderValue(WMSlider *slider, int value);
  1022.  
  1023. void WMSetSliderContinuous(WMSlider *slider, Bool flag);
  1024.  
  1025. void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
  1026.  
  1027. void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
  1028.  
  1029. void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
  1030.  
  1031. /* ....................................................................... */
  1032.  
  1033. /* only supports 2 subviews */
  1034. WMSplitView *WMCreateSplitView(WMWidget *parent);
  1035.  
  1036. void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
  1037.  
  1038. void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
  1039.  
  1040. void WMSetSplitViewConstrainProc(WMSplitView *sPtr, 
  1041.                  WMSplitViewConstrainProc *proc);
  1042.  
  1043. /*
  1044. void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr, 
  1045.                       WMSplitViewResizeSubviewsProc *proc);
  1046. */
  1047.  
  1048. int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
  1049.  
  1050.  
  1051. /* ....................................................................... */
  1052.  
  1053. int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg, 
  1054.             char *defaultButton, char *alternateButton, 
  1055.             char *otherButton);
  1056.  
  1057. /* you can free the returned string */
  1058. char *WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
  1059.               char *defaultText, char *okButton, char *cancelButton);
  1060.  
  1061. WMAlertPanel *WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
  1062.                  char *msg, char *defaultButton, 
  1063.                  char *alternateButton, char *otherButton);
  1064.  
  1065. WMInputPanel *WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
  1066.                  char *msg, char *defaultText, char *okButton, 
  1067.                  char *cancelButton);
  1068.  
  1069. void WMDestroyAlertPanel(WMAlertPanel *panel);
  1070.  
  1071. void WMDestroyInputPanel(WMInputPanel *panel);
  1072.  
  1073. /* ....................................................................... */
  1074.  
  1075. /* only 1 instance per WMScreen */
  1076. WMOpenPanel *WMGetOpenPanel(WMScreen *scrPtr);
  1077.  
  1078. WMSavePanel *WMGetSavePanel(WMScreen *scrPtr);
  1079.  
  1080. void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
  1081.  
  1082. void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
  1083.  
  1084. void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
  1085.  
  1086. void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
  1087.  
  1088. /* you can free the returned string */
  1089. char *WMGetFilePanelFileName(WMFilePanel *panel);
  1090.  
  1091. void WMFreeFilePanel(WMFilePanel *panel);
  1092.  
  1093. int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
  1094.                                     char *path, char *name, char **fileTypes);
  1095.  
  1096. void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
  1097.  
  1098. WMView *WMGetFilePanelAccessoryView(WMFilePanel *panel);
  1099.  
  1100.  
  1101. /* ...................................................................... */
  1102.  
  1103. /* only 1 instance per WMScreen */
  1104. WMFontPanel *WMGetFontPanel(WMScreen *scr);
  1105.  
  1106. void WMShowFontPanel(WMFontPanel *panel);
  1107.  
  1108. void WMHideFontPanel(WMFontPanel *panel);
  1109.  
  1110. void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
  1111.  
  1112. /* you can free the returned string */
  1113. char *WMGetFontPanelFontName(WMFontPanel *panel);
  1114.  
  1115. WMFont *WMGetFontPanelFont(WMFontPanel *panel);
  1116.  
  1117. #ifdef __cplusplus
  1118. }
  1119. #endif /* __cplusplus */
  1120.  
  1121. #endif
  1122.  
  1123.